import React, { Component } from 'react'
import News from './News'
import Phone from './Phone'
import axios from 'axios'

export default class Home extends Component {
    constructor(props) {
        super(props)
        this.state = {
            text: '默认值'
        }
        this.dataFun = this.dataFun.bind(this)
    }
    componentDidMount(){
        axios.get('/api/101320101.html').then((data)=>{
            console.log(data.data.weatherinfo)
        })
    }
    dataFun(text) {
        this.setState({
            text
        })
    }
    render() {
        return (
            <div>
                12
                {this.state.text}
                <img alt='jj' src={require("../assets/logo.svg")} />
                <News text='12' fufun={this.dataFun} />
                <Phone />
            </div>
        )
    }
}